
#include "Component\LRG_ViewerComponent.h"

ULRG_ViewerComponent* ULRG_ViewerComponent::Get(AActor* Viewer)
{
	if(!Viewer)
	{
		return nullptr;
	}
	UActorComponent* Component = Viewer->GetComponentByClass(ULRG_ViewerComponent::StaticClass() );
	if (!Component)
	{
		ULRG_ViewerComponent* ViewerComponent = NewObject<ULRG_ViewerComponent>(Viewer);
		ViewerComponent->RegisterComponent();
		return ViewerComponent;
	}
	return Cast<ULRG_ViewerComponent>(Component);
}

ULRG_ViewerComponent::ULRG_ViewerComponent(const FObjectInitializer& ObjectInitializer):Super(ObjectInitializer)
{
	VisibleLines.Add( FName (TEXT("TestLine_0")) );
}

void ULRG_ViewerComponent::AddVisibleLine(const FName& Line)
{
	VisibleLines.Add(Line);
}

void ULRG_ViewerComponent::RemoveVisibleLine(const FName& Line)
{
	VisibleLines.Remove(Line);
}